package com.ck.daoImpl;

import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.ck.dao.ZhuguanDAO;
import com.ck.domain.Zhuguan;

public class ZhuguanDAOImpl extends SqlMapClientDaoSupport implements
		ZhuguanDAO {
	
	public List<Zhuguan> getAllZhuguan() {
		return (List<Zhuguan>)getSqlMapClientTemplate().queryForList("getAllZhuguan");
	}
	
	public Zhuguan getZhuguanById(Integer id) {
		return (Zhuguan) getSqlMapClientTemplate().queryForObject("getZhuguanById",id);
	}

	public List<Zhuguan> getZhuguanByChapter(Integer chapter) {
		return (List<Zhuguan>) getSqlMapClientTemplate().queryForList("getZhuguanByChapter",chapter);
	}

	public void addNewZhuguan(Zhuguan zhuguan) {
		getSqlMapClientTemplate().insert("addNewZhuguan", zhuguan);
	}

	public void updateZhuguanInfo(Zhuguan zhuguan) {
		getSqlMapClientTemplate().update("updateZhuguanInfo", zhuguan);
	}

	public void removeZhuguanImage(Zhuguan zhuguan) {
		getSqlMapClientTemplate().update("removeZhuguanImage", zhuguan);
	}

}
